﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Guild.aspx.cs" Inherits="_2011DBProject.Guild" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link rel=StyleSheet HREF='design1.css' type='text/css'>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>새벽 골프</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
            <p align =left>
        <asp:Button ID="btnGoLogout" runat="server" onclick="btnGoLogout_onclick" 
            Text="☜ 로 그 아 웃" Width="150px" />
        <asp:Button ID="btnGoServer" runat="server" onclick="btnGoServer_onclick" 
            Text="☜ 서 버 선 택" Width="150px" />
        <asp:Button ID="btnGoCharacter" runat="server" onclick="btnGoCharacter_onclick" 
            Text="☜ 캐 릭 선 택" Width="150px" />
        <asp:Button ID="btnGoChannel" runat="server" onclick="btnGoChannel_onclick" 
            Text="☜ 채 널 선 택" Width="150px" />
        <asp:Button ID="btnGoMain" runat="server" onclick="btnGoMain_onclick" 
            Text="☜ 메 인 화 면" Width="150px" />
        </p>
        <br />
        <br />
    
        <asp:Label ID="lblGuildYN" runat="server" Text="가입된 길드가 없습니다." Visible="False" ForeColor="#ffff99"></asp:Label>
            <br />
            <br />
            <br />
        <br />
        <asp:Button ID="btnMakeGuild" runat="server" onclick="btnMakeGuild_Click" 
            Text="길 드 생 성" Width="279px" Height="49px" Font-Size="22pt" />
            <br />
            <br />
        <br />
        <br />
    
            <asp:Label ID="Label10" runat="server" Font-Size="25pt" 
            ForeColor="#9EDCFF" Text="서버의 길드 목록"></asp:Label>
        <asp:GridView ID="gvGuildList" runat="server" AutoGenerateColumns="False" 
                CellPadding="4" DataSourceID="sqldsEnGuild" 
            EmptyDataText="현재 서버에 길드가 없습니다." ForeColor="#FFFF99" GridLines="None" 
            DataKeyNames="GUILD_NAME" 
            onselectedindexchanged="gvGuildList_SelectedIndexChanged" 
                HorizontalAlign="Center">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="GUILD_NAME" HeaderText="길드명" 
                    SortExpression="GUILD_NAME" >
                <HeaderStyle Width="200px" Wrap="True" />
                </asp:BoundField>
                <asp:BoundField DataField="GUILD_MASTER_NAME" HeaderText="길드마스터" 
                    SortExpression="GUILD_MASTER_NAME" />
                <asp:BoundField DataField="GUILD_GRADE" HeaderText="등급" 
                    SortExpression="GUILD_GRADE" />
                <asp:BoundField DataField="MEMBER_LIMIT" HeaderText="인원제한" 
                    SortExpression="MEMBER_LIMIT" />
                <asp:BoundField DataField="GUILD_POINT" HeaderText="포인트" 
                    SortExpression="GUILD_POINT" />
                <asp:BoundField DataField="GUILD_BENEFIT_NO" HeaderText="GUILD_BENEFIT_NO" 
                    SortExpression="GUILD_BENEFIT_NO" Visible="False" />
                <asp:BoundField DataField="GUILD_VMASTER_NAME" HeaderText="GUILD_VMASTER_NAME" 
                    SortExpression="GUILD_VMASTER_NAME" Visible="False" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="sqldsEnGuild" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
            
            SelectCommand="SELECT &quot;GUILD_MASTER_NAME&quot;, &quot;GUILD_VMASTER_NAME&quot;, &quot;GUILD_NAME&quot;, &quot;GUILD_GRADE&quot;, &quot;MEMBER_LIMIT&quot;, &quot;GUILD_POINT&quot;, &quot;GUILD_BENEFIT_NO&quot; FROM &quot;GUILD&quot; WHERE (&quot;SERVER_NO&quot; = :SERVER_NO)">
            <SelectParameters>
                <asp:SessionParameter Name="SERVER_NO" SessionField="SERVER" Type="Decimal" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <asp:Label ID="lblGuildList" runat="server" Text="선택된 길드가 없습니다."></asp:Label>
        <asp:Button ID="btnJoinGuild" runat="server" onclick="btnJoinGuild_Click" 
            Text="길드에 가입하기" />
        <br />
            <br />
            <br />
            <br />
            <br />
        <br />
        <br />
    
            <asp:Label ID="Label1" runat="server" Font-Size="25pt" 
            ForeColor="#9EDCFF" Text="나의 길드"></asp:Label>
        <asp:GridView ID="gvGuild" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataSourceID="sqldsGuild" DataKeyNames ="GUILD_NAME"
            EmptyDataText="가입된 길드가 없습니다." ForeColor="#FFFF99" GridLines="None" 
            onselectedindexchanged="gvGuild_SelectedIndexChanged" HorizontalAlign="Center">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" />
            <Columns>
                <asp:BoundField DataField="GUILD_NAME" HeaderText="길드명" 
                    SortExpression="GUILD_NAME" >
                <HeaderStyle Width="200px" />
                </asp:BoundField>
                <asp:BoundField DataField="GUILD_MASTER_NAME" HeaderText="길드마스터" 
                    SortExpression="GUILD_MASTER_NAME" />
                <asp:BoundField DataField="GUILD_GRADE" HeaderText="등급" 
                    SortExpression="GUILD_GRADE" />
                <asp:BoundField DataField="MEMBER_LIMIT" HeaderText="인원제한" 
                    SortExpression="MEMBER_LIMIT" />
                <asp:BoundField DataField="GUILD_POINT" HeaderText="포인트" 
                    SortExpression="GUILD_POINT" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="sqldsGuild" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
            SelectCommand="SELECT GUILD_NAME, GUILD_MASTER_NAME, GUILD_VMASTER_NAME, GUILD_GRADE, MEMBER_LIMIT, GUILD_POINT, GUILD_BENEFIT_NO, MEMBER_GRADE, CHARACTER_NAME FROM V_ENTERED_GUILD WHERE (CHARACTER_NAME = :CHARACTER_NAME) AND (SERVER_NO = :SERVER_NO)">
            <SelectParameters>
                <asp:SessionParameter Name="CHARACTER_NAME" SessionField="CHARACTER_NAME" />
                <asp:SessionParameter Name="SERVER_NO" SessionField="SERVER" Type="Decimal" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:Button ID="btnJoinGuild0" runat="server" onclick="btnExitGuild" 
            Text="길드에서 탈퇴하기." />
        <br />
        <br />
    
            <br />
            <br />
            <br />
        <asp:GridView ID="gvGuildMember" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataSourceID="sqldsGuildMember" EmptyDataText="가입된 길드가 없습니다."
            ForeColor="#FFFF99" GridLines="None" 
                HorizontalAlign="Center" DataKeyNames="CHARACTER_NAME,GUILD_NAME,SERVER_NO"
                onselectedindexchanged="gvGuildMember_SelectedIndexChanged" 
                Visible="False">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center"/>
            <Columns>
                <asp:CommandField SelectText="추방" ShowEditButton="True" ShowSelectButton="True" 
                    UpdateText="승격및강등" />
                <asp:BoundField DataField="CHARACTER_NAME" HeaderText="CHARACTER_NAME" 
                    SortExpression="CHARACTER_NAME" ReadOnly="True" />
                <asp:BoundField DataField="MEMBER_GRADE" HeaderText="MEMBER_GRADE" 
                    SortExpression="MEMBER_GRADE" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
            <br />
    
            <asp:Label ID="lblGuild" runat="server" Font-Size="25pt" 
            ForeColor="#FFFF99" Visible="False"></asp:Label>
    
            <asp:Label ID="Label13" runat="server" Font-Size="25pt" 
            ForeColor="#9EDCFF" Text="길드 멤버 보기" Visible="False"></asp:Label>
        <asp:SqlDataSource ID="sqldsGuildMember" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
            
                SelectCommand="SELECT &quot;CHARACTER_NAME&quot;, &quot;MEMBER_GRADE&quot;, &quot;GUILD_NAME&quot;, &quot;SERVER_NO&quot; FROM &quot;GUILD_MEMBER&quot; WHERE ((&quot;SERVER_NO&quot; = :SERVER_NO) AND (&quot;GUILD_NAME&quot; = :GUILD_NAME))" 
                ConflictDetection="CompareAllValues" 
                DeleteCommand="DELETE FROM &quot;GUILD_MEMBER&quot; WHERE &quot;CHARACTER_NAME&quot; = :original_CHARACTER_NAME AND &quot;GUILD_NAME&quot; = :original_GUILD_NAME AND &quot;SERVER_NO&quot; = :original_SERVER_NO AND ((&quot;MEMBER_GRADE&quot; = :original_MEMBER_GRADE) OR (&quot;MEMBER_GRADE&quot; IS NULL AND :original_MEMBER_GRADE IS NULL))" 
                InsertCommand="INSERT INTO &quot;GUILD_MEMBER&quot; (&quot;CHARACTER_NAME&quot;, &quot;MEMBER_GRADE&quot;, &quot;GUILD_NAME&quot;, &quot;SERVER_NO&quot;) VALUES (:CHARACTER_NAME, :MEMBER_GRADE, :GUILD_NAME, :SERVER_NO)" 
                OldValuesParameterFormatString="original_{0}" 
                UpdateCommand="UPDATE &quot;GUILD_MEMBER&quot; SET &quot;MEMBER_GRADE&quot; = :MEMBER_GRADE WHERE &quot;CHARACTER_NAME&quot; = :original_CHARACTER_NAME AND &quot;GUILD_NAME&quot; = :original_GUILD_NAME AND &quot;SERVER_NO&quot; = :original_SERVER_NO AND ((&quot;MEMBER_GRADE&quot; = :original_MEMBER_GRADE) OR (&quot;MEMBER_GRADE&quot; IS NULL AND :original_MEMBER_GRADE IS NULL))">
            <SelectParameters>
                <asp:SessionParameter Name="SERVER_NO" SessionField="SERVER" 
                    Type="Decimal" />
                <asp:SessionParameter Name="GUILD_NAME" SessionField="GUILD_NAME" 
                    Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="original_CHARACTER_NAME" Type="String" />
                <asp:Parameter Name="original_GUILD_NAME" Type="String" />
                <asp:Parameter Name="original_SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="original_MEMBER_GRADE" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="MEMBER_GRADE" Type="String" />
                <asp:Parameter Name="original_CHARACTER_NAME" Type="String" />
                <asp:Parameter Name="original_GUILD_NAME" Type="String" />
                <asp:Parameter Name="original_SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="original_MEMBER_GRADE" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="CHARACTER_NAME" Type="String" />
                <asp:Parameter Name="MEMBER_GRADE" Type="String" />
                <asp:Parameter Name="GUILD_NAME" Type="String" />
                <asp:Parameter Name="SERVER_NO" Type="Decimal" />
            </InsertParameters>
        </asp:SqlDataSource>
            <asp:Button ID="btnKick" runat="server" Height="31px" onclick="btnKick_Click" 
                Text="선택회원 추방 또는 길드폐쇄" Width="334px" 
                Visible="false" />
            <asp:Label ID="lblisMaster" runat="server" Font-Bold="True" Font-Size="Large" 
                ForeColor="#FF6666" Text="길드마스터가 먼저 탈퇴할수는 없습니다!" Visible="False"></asp:Label>
        <br />
    
            <br />
            <br />
    
            <asp:Label ID="Label12" runat="server" Font-Size="25pt" 
            ForeColor="#9EDCFF" Text="길드 락커룸"></asp:Label>
        <asp:GridView ID="gvGuildLocker" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames ="ITEM_NO"
            DataSourceID="sqldsGuildLocker" EmptyDataText="가입된 길드가 없거나 길드 락커룸에 아이템이 없습니다."
            ForeColor="#FFFF99" GridLines="None" HorizontalAlign="Center">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="ITEM_NO" HeaderText="ITEM_NO" 
                    SortExpression="ITEM_NO" />
                <asp:BoundField DataField="GUILD_NAME" HeaderText="GUILD_NAME" 
                    SortExpression="GUILD_NAME" />
                <asp:BoundField DataField="ITEM_NAME" HeaderText="ITEM_NAME" 
                    SortExpression="ITEM_NAME" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="sqldsGuildLocker" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
            
            SelectCommand="SELECT GUILD_LOCKERROOM.ITEM_NO, GUILD_LOCKERROOM.GUILD_NAME, ITEM.ITEM_NAME FROM GUILD_LOCKERROOM, ITEM WHERE GUILD_LOCKERROOM.ITEM_NO = ITEM.ITEM_NO AND (GUILD_LOCKERROOM.SERVER_NO = :SERVER_NO) AND (GUILD_LOCKERROOM.GUILD_NAME = :GUILD_NAME)">
            <SelectParameters>
                <asp:SessionParameter Name="SERVER_NO" 
                    SessionField="SERVER" Type="Decimal" />
                <asp:ControlParameter ControlID="gvGuild" Name="GUILD_NAME" 
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
    
    </div>
    </form>
</body>
</html>
